package beautiful.butterfly.drds.data_exchange.plugin;


import beautiful.butterfly.drds.data_exchange.util.Configuration;

import java.sql.SQLException;

public abstract class AbstractPlugin implements Pluginable
{
    //作业的config
    private Configuration pluginJobConf;

    //插件本身的plugin
    private Configuration pluginConf;

    // by qiangsi.lq。 修改为对端的作业configuration
    private Configuration peerPluginJobConf;

    private String peerPluginName;


    public String getPluginName()
    {
        assert null != this.pluginConf;
        return this.pluginConf.getString("name");
    }


    public String getDeveloper()
    {
        assert null != this.pluginConf;
        return this.pluginConf.getString("developer");
    }


    public String getDescription()
    {
        assert null != this.pluginConf;
        return this.pluginConf.getString("description");
    }


    public Configuration getPluginJobConf()
    {
        return pluginJobConf;
    }


    public void setPluginJobConf(Configuration pluginJobConf)
    {
        this.pluginJobConf = pluginJobConf;
    }


    public void setPluginConf(Configuration configuration)
    {
        this.pluginConf = configuration;
    }


    public Configuration getPeerPluginJobConf()
    {
        return peerPluginJobConf;
    }


    public void setPeerPluginJobConf(Configuration peerPluginJobConf)
    {
        this.peerPluginJobConf = peerPluginJobConf;
    }


    public String getPeerPluginName()
    {
        return peerPluginName;
    }


    public void setPeerPluginName(String peerPluginName)
    {
        this.peerPluginName = peerPluginName;
    }

    public void preCheck() throws SQLException
    {
    }

    public void prepare() throws SQLException
    {
    }

    public void post() throws SQLException
    {
    }

    public void preHandler(Configuration jobConfiguration) throws SQLException
    {

    }

    public void postHandler(Configuration jobConfiguration) throws SQLException
    {

    }
}
